<template>
	<view class="store bgff r9 mx12 mb10 shadow">
		<view class="flex flexC flexB py13 px14 titlebox">
			<text class="c00 fs16 mr10 bold6 flex1 ellipsis1">{{item.name}}</text>
			<text v-if="item.status_txt == '营业中'" class="status r3 fs10 bgf95 aliC px6 py2 bold6">{{item.status_txt}}</text>
			<text v-if="item.status_txt == '筹备中'" class="status r3 fs10 bgf95  aliC px6 py2 bold6">{{item.status_txt}}</text>
			<text v-if="item.status_txt == '试营业'" class="status r3 fs10 bgf95 aliC px6 py2 bold6">{{item.status_txt}}</text>
			<text v-if="item.status_txt == '休息中'" class="status r3 fs10 bgf95 aliC px6 py2 bold6">{{item.status_txt}}</text>
			
		</view>
		<view class="px14 py12 flex flexC " @click="detail(item)">
			<!-- <view class="rel">
				<image  class="logo r9" v-if="item.is_ktv=='1'" src="https://img.quexiaqp.com/uploads/20241220/cc06b0623fad5934f47f0aa34545f478.png" mode="aspectFill"></image>
				<image  class="logo r9" v-else-if="item.shop_type=='棋牌'" src="https://img.quexiaqp.com/uploads/20241224/275580096744181584d1051d060b208b.png" mode="aspectFill"></image>
				<image  class="logo r9" v-else-if="item.shop_type=='台球'" src="https://img.quexiaqp.com/uploads/20241224/77851c6946a62b56dcb059a90271d764.png" mode="aspectFill"></image>
				<image  class="logo r9" v-else-if="item.shop_type=='棋牌台球' || item.shop_type=='台球棋牌'" src="https://img.quexiaqp.com/uploads/20241224/c128fdecfefe9e50825d2342be57c237.png" mode="aspectFill"></image>
				
			</view> -->
			
			
			<view class="rel">
				<image  class="logo r9" v-if="item.is_ktv=='1' && item.store_type == '1'" src="https://img.quexiaqp.com/uploads/20250830/7fe656704bf59ed6ae8485ac37ab5609.png" mode="aspectFill"></image>
				<image  class="logo r9" v-else-if="item.is_ktv=='1' && item.store_type == '2'" src="https://img.quexiaqp.com/uploads/20250830/c24d2a67b250ba2df4d3de12aaeb95b8.png" mode="aspectFill"></image>
				<image  class="logo r9" v-else-if="item.is_ktv=='1' && item.store_type == '3'" src="https://img.quexiaqp.com/uploads/20250928/f0d0e70e83fe770425078f154d2bad05.png" mode="aspectFill"></image>
				
				<image  class="logo r9" v-else-if="item.shop_type=='棋牌' && item.store_type == '1'" src="https://img.quexiaqp.com/uploads/20250830/965ba681207deb626e86354206d1ac90.png" mode="aspectFill"></image>
				<image  class="logo r9" v-else-if="item.shop_type=='棋牌' && item.store_type == '2'" src="https://img.quexiaqp.com/uploads/20250830/fc3007913177e8ca9457892efdd75513.png" mode="aspectFill"></image>
				<image  class="logo r9" v-else-if="item.shop_type=='棋牌' && item.store_type == '3'" src="https://img.quexiaqp.com/uploads/20250928/8d7b8e0590fe72506e44b1973bdcca09.png" mode="aspectFill"></image>
				
				<image  class="logo r9" v-else-if="item.shop_type=='台球' && item.store_type == '1'" src="https://img.quexiaqp.com/uploads/20250830/18fd57a3dac4b1219764e267628ac502.png" mode="aspectFill"></image>
				<image  class="logo r9" v-else-if="item.shop_type=='台球' && item.store_type == '2'" src="https://img.quexiaqp.com/uploads/20250830/db103cd046f593e2cedd0ee791ef4f1b.png" mode="aspectFill"></image>
				<image  class="logo r9" v-else-if="item.shop_type=='台球' && item.store_type == '3'" src="https://img.quexiaqp.com/uploads/20250928/11d7ac624942459fc9c383deab9c1fc6.png" mode="aspectFill"></image>
				
				<image  class="logo r9" v-else-if="(item.shop_type=='棋牌台球' || item.shop_type=='台球棋牌') && item.store_type == '1'" src="https://img.quexiaqp.com/uploads/20250830/2515981f55b6c88a8759d7b97f05e2dc.png" mode="aspectFill"></image>
				<image  class="logo r9" v-else-if="(item.shop_type=='棋牌台球' || item.shop_type=='台球棋牌') && item.store_type == '2'" src="https://img.quexiaqp.com/uploads/20250830/38ccc047d50694934b1911aad7fb8f28.png" mode="aspectFill"></image>
				<image  class="logo r9" v-else-if="(item.shop_type=='棋牌台球' || item.shop_type=='台球棋牌') && item.store_type == '2'" src="https://img.quexiaqp.com/uploads/20250928/4f120dad55939f2acb2189461956ec75.png" mode="aspectFill"></image>
				
			</view>
			
			<view class="flex1 pl12">
				<!-- <view class="flex flexC">
					<text class="fs10 bgf6c r2 px4 bold6">标准店</text>
					<text class="c00 dinline mx10 bold6 flex1 ellipsis1">{{item.name}}</text>
					<text v-if="item.status_txt == '营业中'" class="status r40 fs10 bgf6c aliC px6 py2 bold6">{{item.status_txt}}</text>
					<text v-if="item.status_txt == '筹备中'" class="status r40 fs10 bgff0  aliC px6 py2 bold6">{{item.status_txt}}</text>
					<text v-if="item.status_txt == '试营业'" class="status r40 fs10 bgf6c aliC px6 py2 bold6">{{item.status_txt}}</text>
					<text v-if="item.status_txt == '休息中'" class="status r40 fs10 bgb5 aliC px6 py2 bold6">{{item.status_txt}}</text>
				</view> -->
				<view class="ellipsis2 c85 fs13" >
					<!-- <image class="local aliM" src="/static/img/icon/address.png" mode="widthFix"></image> -->
					<text class="aliM">{{item.address}}</text>
				</view>
				<view class="flex flexC mt8" >
					<text class="c85 fs11">{{item.distance}}</text>
					<text v-if="index == 0"  class="ced tag r3 px4 fs10 ml4">距您最近</text>
					<text class="ced fs10 flex1 aliR">{{item.bookTime}}</text>
				</view>
				<view class="mt8 fs12 c1a flex flexC mt10">
					<view class="bgf5 r2 mr9 flex flexC" v-if="item.qp == 1">
						<image class="w17" src="/static/img/icon/pai.png" mode="aspectFit"></image>
						<text class="c1b ml2">棋牌</text>
					</view>
					<view class="bgf5 r2 mr9 flex flexC" v-if="item.tq == 1">
						<image class="w17" src="/static/img/icon/ball.png" mode="aspectFit"></image>
						<text class="c57 ml2">台球</text>
					</view>
					<view class="bgf5 r2 flex flexC" v-if="item.is_ktv == 1">
						<image class="w17" src="/static/img/icon/ktv.png" mode="aspectFit"></image>
						<text class="c90 ml2">KTV</text>
					</view>
				</view>
				<view class="fs13 flex flexC mt16">
					<image @click.stop="location(item)" class="w44" src="/static/img/icon/local2.png" mode="aspectFill"></image>
					<image @click.stop="call(item)" class="w44 ml14" src="/static/img/icon/call3.png" mode="aspectFill"></image>
					<text class="flex1" ></text>
					<text class="bgf5c c33 px16 py10 r40 ml14" >立即预定</text>
				</view>
			</view>
		</view>
	</view>
	
</template>

<script>
	export default {
		name:"storeItem",
		props: {
			item: {
				type: Object,
				default: {}
			},
			index: {
				type: Number,
				default: {}
			}
		},
		methods: {
			
			look(img){
				let image = Array();
				image.push(img);
				uni.previewImage({
					urls:image,
				});
			},
			
			location(item){
				this.$emit("location",item)
			},
			call(item){
				this.$emit("call",item)
				
			},
			detail(item){
				if(item.shop_type == 'KTV'){
					uni.navigateToMiniProgram({
						appId:"wx86160f502fd2c58b",
					    path: 'pages/home/index2'// path 路径
					})
				}else{
					this.$emit("detail",item)
				}
				
				
			}
		}
	}
</script>

<style lang="scss" scoped>
.store {
	.ced {color: #ED7F5A;}
	.c1b {color: #1bb135;}
	.tag {border: 2rpx solid #F95C28;}
	.titlebox {
		background: linear-gradient(to right,#FFFBE3,#FFF6C5);
		border-radius: 18rpx 18rpx 0 0;
	}
	.rel {
		position: relative;
		.status {position: absolute;bottom: 10rpx;left: 10rpx;}
	}
	.logo {width: 210rpx;height: 280rpx;}
	.ellipsis1 {width: 436rpx;
		&.flex1 {width: 280rpx;}
	}
	.w17 {width: 34rpx;height: 34rpx;}
	.bgf95 {background-color: #F95C28;;color:#FFF}
	.cf95 {color: #F95C28;}
	.local {width: 24rpx;height: 24rpx;}
	.w44 {width: 88rpx;height: 68rpx;}
	.bgf5c {background-color: #F5C51D;}
}
</style>